﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiPixelBGRA32 : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiPixelBGRA32(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiPixelBGRA32 obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiPixelBGRA32()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiPixelBGRA32(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGiPixelBGRA32() : this(GlobalsPINVOKE.new_OdGiPixelBGRA32__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiPixelBGRA32(uint bgra) : this(GlobalsPINVOKE.new_OdGiPixelBGRA32__SWIG_1(bgra), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiPixelBGRA32(byte blue, byte green, byte red, byte alpha) : this(GlobalsPINVOKE.new_OdGiPixelBGRA32__SWIG_2(blue, green, red, alpha), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public uint getBGRA()
		{
			uint result = GlobalsPINVOKE.OdGiPixelBGRA32_getBGRA(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public uint getRGBA()
		{
			uint result = GlobalsPINVOKE.OdGiPixelBGRA32_getRGBA(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public byte blue()
		{
			byte result = GlobalsPINVOKE.OdGiPixelBGRA32_blue(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public byte green()
		{
			byte result = GlobalsPINVOKE.OdGiPixelBGRA32_green(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public byte red()
		{
			byte result = GlobalsPINVOKE.OdGiPixelBGRA32_red(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public byte alpha()
		{
			byte result = GlobalsPINVOKE.OdGiPixelBGRA32_alpha(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBGRA(uint bgra)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setBGRA__SWIG_0(this.swigCPtr, bgra);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setBGRA(byte blue, byte green, byte red, byte alpha)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setBGRA__SWIG_1(this.swigCPtr, blue, green, red, alpha);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setRGBA(uint rgba)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setRGBA__SWIG_0(this.swigCPtr, rgba);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setRGBA(byte red, byte green, byte blue, byte alpha)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setRGBA__SWIG_1(this.swigCPtr, red, green, blue, alpha);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setBlue(byte blue)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setBlue(this.swigCPtr, blue);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setGreen(byte green)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setGreen(this.swigCPtr, green);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setRed(byte red)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setRed(this.swigCPtr, red);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setAlpha(byte alpha)
		{
			GlobalsPINVOKE.OdGiPixelBGRA32_setAlpha(this.swigCPtr, alpha);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
